package calendarInterface2;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.print.PageFormat;
import java.awt.print.Printable;
import java.awt.print.PrinterException;

import javax.swing.JPanel;

public class PrintWindow implements Printable {

	@Override
	public int print(Graphics graphics, PageFormat pf, int page)
			throws PrinterException {
		
		if (page > 0) {
	        return NO_SUCH_PAGE;
	    }
		
		Graphics2D g2d = (Graphics2D) graphics;
		
		g2d.scale(0.5, 0.5);
		
		g2d.translate(50,100);
		
		JPanel aImprimer = (JPanel) CalendarInterface.pCalendarView;
		aImprimer.print(g2d);
		
		return PAGE_EXISTS;
	}

}
